package com.demo.security;


import com.demo.util.Utils;
import com.demo.AppletConstant;

import java.util.HashMap;
import java.util.Map;


/**
 * 支付密码验证流水号
 *
 */
public class VerifyPwdSeqId {
	public static void main(String[] args)  throws Exception{
		
		//调用地址
		String url = "https://open.95516.com/open/access/1.0/verifyPwdSeqId";

		//拼装参数Map
		Map<String, String> params = new HashMap<String, String>(0);
		params.put("appId", AppletConstant.APP_ID);
		params.put("openId", AppletConstant.openId);
		
		//业务操作流水号
		params.put("bizOrderId", "2021070202320957544849");

		params.put("clientIp", "");
		
		//业务类型
		params.put("bizType", "4p");
		
		//商户号
		params.put("merchantId", AppletConstant.APP_ID);
		
		//随机字符串
		String nonceStr = Utils.createNonceStr();
		params.put("nonceStr", nonceStr);
		
		//通知地址
		params.put("notifyUrl", "http://td.nailtechnic.com/index.php/admin/Ysfapplet/lsh");
		
		//时间戳
		String timestamp = String.valueOf(System.currentTimeMillis()/1000);
		params.put("timestamp", timestamp);
		
		//accessToken
		params.put("accessToken", AppletConstant.accessToken);
		
		//签名
		String signature = Utils.sign(params, AppletConstant.SIGN_KEY_PACKET);
		params.put("signature", signature);

		//发送请求
		String resultStr = Utils.sendPostGson(url, params);
		System.out.println("-------支付密码验证流水号:"+resultStr+"---------");
	}
	


}
